package cn.edu.njust.mapper;

import cn.edu.njust.pojo.Register;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * -*- coding: UTF-8 -*-
 *
 * @Project: CCF-Pre-Registration-System
 * @Package: cn.edu.njust.mapper
 * @IDE: IntelliJ IDEA
 * @File: RegisterMapper.java
 * @Author: GZ-WangSong
 * @Date: 2022/12/29 21:27
 * @Description:
 */
public interface RegisterMapper {
    /**
     * 查询所有预报名用户
     * @return
     */
    @Select("SELECT * FROM pre_registration_system.pre_registration")
    @ResultMap("registerResultMap")
    List<Register> selectAllRe();

    /**
     * 查询免费学生
     * @return
     */
    @Select("SELECT count(*) FROM pre_registration_system.pre_registration WHERE is_use ='1'")
    int countByAdmission01();

    /**
     * 查询自费学生
     * @return
     */
    @Select("SELECT count(*) FROM pre_registration_system.pre_registration WHERE is_use ='0'")
    int countByAdmission00();
}
